﻿<%@ Page Language="C#" MasterPageFile="~/Management/Management.master" AutoEventWireup="true"
    CodeFile="PositionCategory.aspx.cs" Inherits="Admin_PositionCategory" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <table>
        <tr>
            <td>
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
                    DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None">
                    <RowStyle BackColor="#EFF3FB" />
                    <Columns>
                        <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" SortExpression="ID" />
                        <asp:BoundField DataField="Name" HeaderText="职位分类" ReadOnly="true" SortExpression="Name" />
                        <asp:TemplateField HeaderText="操作" ShowHeader="False">
                            <ItemTemplate>
                                <asp:Button ID="btn_DUpdate" runat="server" CommandArgument='<%# Eval("ID") %>' OnClick="btn_DUpdate_Click"
                                    Text="编辑" />
                                <asp:Button ID="btn_DDelete" runat="server" Text="删除" OnClick="btn_DDelete_Click"
                                    CommandArgument='<%# Eval("ID") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <EditRowStyle BackColor="#2461BF" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:AvatarConnectionString %>" 
                    SelectCommand="SELECT [ID], [Name] FROM [Position] WHERE ([FatherID] = @FatherID)">
                    <SelectParameters>
                        <asp:Parameter DefaultValue="0" Name="FatherID" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </td>
            <td style="vertical-align: top;">
                <asp:Button ID="btn_Add" runat="server" CssClass="Button" Text="添加" OnClick="btn_Add_Click" /><div
                    class="Dialog" runat="server" id="panel_Edit">
                    <div class="Title">
                        编辑</div>
                    <div class="Content">
                        职位名称：<asp:TextBox ID="txt_NameUpdate" runat="server" MaxLength="10"></asp:TextBox>
                        <br />
                        <asp:Button ID="btn_DUpdateSubmit" runat="server" OnClick="btn_DUpdateSubmit_Click"
                            Text="更新" CssClass="Button" />
                        &nbsp;<asp:Button ID="btn_UpdateCancel" runat="server" OnClick="btn_DUpdateCancel_Click"
                            Text="取消" CssClass="Button" />
                        <br />
                    </div>
                </div>
                <div class="Dialog" id="panel_Add" runat="server">
                    <div class="Title">
                        添加</div>
                    <div class="Content">
                        职位名称：<asp:TextBox ID="txt_NameAdd" runat="server" MaxLength="10"></asp:TextBox>&nbsp;
                        <asp:Button ID="btn_AddSubmit" runat="server" Text="添加" OnClick="btn_DAddSubmit_Click"
                            CssClass="Button" />
                    </div>
                </div>
                <asp:Label ID="lbl_Error" runat="server" ForeColor="Red" EnableViewState="False"></asp:Label><br />
            </td>
        </tr>
    </table>
</asp:Content>
